package RW;

public class TextRect {
	public static void main(String[] args) { 
		Rect[] arr= { new Rect(10,6),new Rect(7,9),
				new Rect(3,12),new Rect(8,7),new Rect(6,6)};
		for (int i = 0; i < arr.length-1; i++) {
			for (int j = 0; j < arr.length-1-i; j++) {
				if (arr[j].getArea()>arr[j+1].getArea()) {
					Rect tmp=arr[i];
					arr[j]=arr[j+1];
					arr[j+1]=tmp;
				}
			}
		}
		for (Rect rect : arr) {
			System.out.println(rect);
		}
	}
}
